package stu;

import java.io.File;
import java.io.IOException;
import java.sql.Timestamp;
import java.time.*;
import java.util.Arrays;
import java.util.Date;

public class IoTest {
    public static void main(String[] args) throws IOException {
        String path = "D:/QQMusicCache/QQMusicSingerPicture/双笙 (陈元汐)/1011983";
        String path1 = "./src";
        File file = new File(path);
        System.out.println(file.getCanonicalPath());
        System.out.println(Arrays.toString(file.list()));
        System.out.println(Arrays.toString(File.listRoots()));
        System.out.println(file.canExecute());
        System.out.println(file.canRead());
        System.out.println(file.canRead());
        System.out.println(file.getFreeSpace()/1024/1024/1024+"G");
        System.out.println(file.getUsableSpace()/1024/1024/1024+"G");
        System.out.println(file.getTotalSpace()/1024/1024/1024+"G");
        long epochSecond = file.lastModified();
        ZoneOffset zoneOffset = ZoneOffset.UTC;
        Date date = new Date(epochSecond);
        System.out.println(date);
        System.out.println(new Date(epochSecond));
        System.out.println(LocalDateTime.ofEpochSecond(epochSecond,20, ZoneOffset.UTC));
        System.out.println(file.length());
        file = new File(path1);
        System.out.println(file.getParent());
        System.out.println(file.getCanonicalPath());
        System.out.println(file.getCanonicalFile());
    }
}
